package 类和对象;
//封装
public class StudentDemo {
    public static void main(String[] args) {
        Student s=new Student();
        //s.name="林青霞";
        //s.age=18;
        //s.setAge(-30);
        s.setAge(18);
        s.setName("林青霞");

        s.show();

        //使用get方法获得成员变量的值
        //System.out.println(s.getName()+"---"+s.getAge());
        //System.out.println(s.getName()+","+s.getAge());

        Student s1=new Student("林青霞");
        Student s2=new Student(20);
        Student s3=new Student("张曼玉",25);
        s1.show();;
        s2.show();
        s3.show();
    }
}
